package crud.server.util;

import common.utils.AppContext;

import crud.client.data.authentication.AuthenticatedUserAdapter;
import crud.client.data.authentication.AuthenticationAdapter;

public class ServiceLocator
{
	static
	{
		AppContext.setApplicationContextPath("/ressource/parametrage-base-cible.xml");
	}

	public static AuthenticationAdapter getAuthenticationAdapter()
	{
		try
		{
			return (AuthenticationAdapter) AppContext.getApplicationContext().getBean("AuthenticationAdapter");
		} catch (Exception e)
		{
			return null;
		}
	}
	
	public static AuthenticatedUserAdapter getAuthenticatedUserAdapter()
	{
		try
		{
			return (AuthenticatedUserAdapter) AppContext.getApplicationContext().getBean("AuthenticatedUserAdapter");
		} catch (Exception e)
		{
			return null;
		}
	}

}
